<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Gemp-LotR</title>

    <link rel="stylesheet" type="text/css" href="css/gemp-001/hall.css">

    <link rel="stylesheet" type="text/css" href="css/dark-hive/jquery-ui-1.8.16.custom.css">
    <link rel="stylesheet" type="text/css" href="css/jquery.contextMenu.css">
    <link rel="stylesheet" type="text/css" href="js/jquery/styles/jquery.spinnercontrol.css">

    <script type="text/javascript" src="js/jquery/jquery-1.6.2.js"></script>
    <script type="text/javascript" src="js/jquery/jquery-ui-1.8.16.custom.min.js"></script>
    <script type="text/javascript" src="js/jquery/jquery.cookie.js"></script>
    <script type="text/javascript" src="js/jquery/jquery.spinnercontrol.js"></script>
    <script type="text/javascript" src="js/jquery/jquery.layout.js"></script>
    <script type="text/javascript" src="js/jquery/jquery.touchSwipe.js"></script>

    <script type="text/javascript" src="js/gemp-019/inheritance.js"></script>
    <script type="text/javascript" src="js/gemp-019/common.js"></script>
    <script type="text/javascript" src="js/gemp-019/logging.js"></script>
    <script type="text/javascript" src="js/gemp-019/chat.js"></script>
    <script type="text/javascript" src="js/gemp-019/communication.js"></script>
    <script type="text/javascript" src="js/gemp-019/deliveryService.js"></script>
    <script type="text/javascript" src="js/gemp-019/commonUi.js"></script>
    <script type="text/javascript" src="js/gemp-019/cardFilter.js"></script>

    <script type="text/javascript" src="js/gemp-019/jCardGroup.js"></script>
    <script type="text/javascript" src="js/gemp-019/set20.js"></script>
    <script type="text/javascript" src="js/gemp-019/jCards.js"></script>

    <script type="text/javascript" src="js/gemp-019/hallUi.js"></script>
    <script type="text/javascript" src="js/gemp-019/leagueResultsUi.js"></script>
    <script type="text/javascript" src="js/gemp-019/tournamentResultsUi.js"></script>
    <script type="text/javascript" src="js/gemp-019/statsUi.js"></script>
    <script type="text/javascript" src="js/gemp-019/playerStatsUi.js"></script>
    <script type="text/javascript" src="js/gemp-019/gameHistoryUi.js"></script>
    <script type="text/javascript" src="js/gemp-019/deckBuildingUi.js"></script>
    <script type="text/javascript" src="js/gemp-019/gameUi.js"></script>
    <script type="text/javascript" src="js/gemp-019/gameAnimations.js"></script>
    <script type="text/javascript" src="js/gemp-019/merchantUi.js"></script>

<script type="text/javascript">
    var chat;
    var hall;

    $(document).ready(
            function () {
                $("#latestNews").append("<div class='serverTime' style='float: right'></div>");
                $("#latestNews").append("<b>All sets are available to play.</b> "
                        + "If you find any problems with specific card or rules in general, please report it via e-mail - <a href='mailto:marcins78@gmail.com'>marcins78@gmail.com</a>.");

                chat = new ChatBoxUI("Game Hall", $("#chat"), "/gemp-lotr-server", true, null, false, true);
                chat.setBounds(2, 2, 780 - 4, 200 - 4);
                chat.showTimestamps = true;

                hall = new GempLotrHallUI($("#hall"), "/gemp-lotr-server", chat);

                $("#tabs").tabs();

                $(window).resize(function () {
                    resizeHall();
                });

                resizeHall();

                var infoDialog = $("<div></div>")
                        .dialog({
                            autoOpen:false,
                            closeOnEscape:true,
                            resizable:false,
                            title:"Card information"
                        });

                $("body").click(
                        function (event) {
                            var tar = $(event.target);

                            if (tar.hasClass("cardHint")) {
                                var blueprintId = tar.attr("value");
                                var card = new Card(blueprintId, "SPECIAL", "hint", "");

                                infoDialog.html("");
                                infoDialog.html("<div style='scroll: auto'></div>");
                                var floatCardDiv = $("<div style='float: left;'></div>");
                                floatCardDiv.append(createFullCardDiv(card.imageUrl, card.foil, card.horizontal));
                                infoDialog.append(floatCardDiv);

                                var windowWidth = $(window).width();
                                var windowHeight = $(window).height();

                                var horSpace = 30;
                                var vertSpace = 45;

                                infoDialog.dialog({title:"Card information"});
                                if (card.horizontal) {
                                    // 500x360
                                    infoDialog.dialog({width:Math.min(500 + horSpace, windowWidth), height:Math.min(360 + vertSpace, windowHeight)});
                                } else {
                                    // 360x500
                                    infoDialog.dialog({width:Math.min(360 + horSpace, windowWidth), height:Math.min(500 + vertSpace, windowHeight)});
                                }
                                infoDialog.dialog("open");

                                event.stopPropagation();
                                return false;
                            } else if (tar.hasClass("prizeHint")) {
                                var prizeDescription = tar.attr("value");

                                infoDialog.text(prizeDescription);

                                infoDialog.dialog({title:"Prizes details", width:300, height: 150});
                                infoDialog.dialog("open");

                                event.stopPropagation();
                                return false;
                            }

                            return true;
                        });
            });

    function resizeHall() {
        var width = $(window).width();
        var height = $(window).height();

        var innerWidth = width - 60;
        var innerHeight = height - 100;

        if (innerHeight < 520)
            innerHeight = 520;
        if (innerWidth < 740)
            innerWidth = 740;

        var middleHeight = (innerHeight - 60) / 2;

        $("#latestNews").css({width:innerWidth + "px", height:30 + "px"});
        $("#motd").css({width:innerWidth + "px", height:30 + "px"});
        $("#hall").css({width:innerWidth + "px", height:middleHeight + "px"});
        $("#chat").css({width:innerWidth + "px", height:middleHeight + "px"});

        chat.setBounds(2, 2, innerWidth - 4, middleHeight - 4);
        hall.hallResized(innerWidth, middleHeight);
    }
</script>

</head>
<body>
<div id="tabs" width="100%">
    <ul>
        <li><a href="#gameHall">Game Hall</a></li>
        <li><a href="includes/coc.html">Code of Conduct</a></li>
        <li><a href="includes/gameHistory.html">Game History</a></li>
        <li><a href="includes/tournamentResults.html">Tournaments</a></li>
        <li><a href="includes/leagueResults.html">Leagues</a></li>
        <script type="text/javascript">
            document.write('<li><a href="includes/leagueRules.html?_=' + (new Date().getTime()) + '">League Rules (updated)</a></li>');
        </script>
        <li><a href="includes/instruction.html">Instructions</a></li>
        <li><a href="/gemp-lotr-server/hall/formats/html">Format Rules</a></li>
        <li><a href="includes/contribute.html">Contribute</a></li>
        <li><a href="includes/yourStats.html">Your stats</a></li>
        <li><a href="includes/stats.html">Server stats</a></li>
        <script type="text/javascript">
            document.write('<li><a href="includes/changeLog.html?_=' + (new Date().getTime()) + '">Change Log</a></li>');
        </script>
    </ul>
    <div id="gameHall">
        <div id="latestNews" style="width:780px;height:30px;"></div>
        <div id="motd" style="width:780px;height:30px;"></div>
        <div id="hall" class="ui-widget-content"
             style="width:780px;height:260px;"></div>
        <div id="chat" class="ui-widget-content"
             style="position:relative;width:780px;height:200px;"></div>
    </div>
</div>
<div id="disclaimer">
    The information presented on this site about LotR TCG, both literal and graphical, is copyrighted by Decipher Inc.
    This website is not produced, endorsed, supported, or affiliated with Decipher.
</div>
</body>
</html>
